% Demonstrate how to draw an image from a file.
clear
clear classes
clc

% access the manager that deals with drawing
dm = dotsTheDrawablesManager.theObject;

% create an object to draw an image from a file
%   the 'Tetons-Sunset.jpg' image is included along with this demo
im = dm.newObject('dotsDrawableImage');
im.fileName = 'Tetons-Sunset.jpg';

% add the image object to a group for the manager to draw.
dm.addObjectToGroup(im, 'demo', 1);
dm.activateGroup('demo');

% open a Psychtoolbox Screen window and show the image
dm.openScreenWindow;
dm.mayDrawNextFrame;
pause(1);

% close the Psychtoolbox Screen window
dm.closeScreenWindow;